/// Author: QP
/// Version: 1.0
/// Date: 2023/05/23
/// 转换HCC互联互通文档为FHIR资源，并提交到FHIR服务器
Class HCC.SVR.Prod.BP.CDAtoFHIR Extends Ens.BusinessProcessBPL
{

/// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]
{
<process language='objectscript' request='Ens.StreamContainer' response='Ens.Response' height='2000' width='2000' >
<context>
<property name='FHIRStream' type='Ens.StreamContainer' instantiate='1' />
<property name='Transformed' type='%Boolean' initialexpression='0' instantiate='0' />
</context>
<sequence xend='200' yend='1050' >
<scope xpos='200' ypos='250' xend='200' yend='950' >
<call name='Transform2FHIR' target='HCC.FHIR.TransformOperation' async='0' xpos='200' ypos='350' >
<request type='Ens.StreamContainer' >
<assign property="callrequest" value="request" action="set" />
</request>
<response type='Ens.StreamContainer' >
<assign property="context.FHIRStream" value="callresponse" action="set" />
<assign property="context.Transformed" value="$IsObject(callresponse)" action="set" />
</response>
</call>
<if name='If transform ok' condition='context.Transformed' xpos='200' ypos='450' xend='200' yend='700' >
<true>
<call name='Revise and Upload to FHIR server' target='HCC.FHIR.ServerOperation' async='1' xpos='335' ypos='600' >
<request type='Ens.StreamContainer' >
<assign property="callrequest" value="context.FHIRStream" action="set" />
</request>
<response type='Ens.StringResponse' />
</call>
</true>
</if>
<faulthandlers>
<catchall xpos='200' ypos='800' xend='200' yend='250' />
</faulthandlers>
</scope>
</sequence>
</process>
}


}
